﻿using System.Collections.Generic;
using Uber.Core.Model;

namespace Uber.Core.Service
{
    public interface IPosts
    {
        long Ask(string title, string body, long userId);
        Post Get(long id);
        IEnumerable<Post> GetSome(int page, int ps);
        void Edit(long id, string title, string body);

        Post Add(string body, long userId, long parentId);
        void Delete(long id);
    }

    public interface IComments
    {
        Comment Add(long postId, long ownerId, string body);
        Comment Get(long id);
        void Delete(long id);
        void Edit(long id, string body, long userId);
    }
    public interface INotifications
    {
        void NewAnswerAdded(long postId, long who, long answerId);
        void NewCommentAdded(long postId, long who, string comment, long commentId);
        void CommentEdited(long postId, long commentId, string comment, string oldcomment, long who);
        void CommentDeleted(long commentId);
        void Read(long nid);
        void ReadAll(long userId);
        void DeleteAll(long userId);
    }

    public interface IAccounts
    {
        
        long OpenIdLogIn(string oid, string email, string name);
        long LogIn(string userName, string password);
        bool EmailExists(string email);
        bool RequestRecover(string email);
        bool ResetPassword(string email, long code, string pass);
        bool Activate(long code, string email);
        string ResendActivationCode(string login);
        bool ChangePass(long id, string pass);
        long MakeCode();
        void SendActivationCode(long code, string email);
        bool Create(string email, string pass, string displayName);
        bool IsPassRight(long id, string pass);
        bool IsRecoverValid(long code, string email);
        void EditProfile(long id, string email, string displayName);
        Account Get(long id);
        void SaveMailSettings(bool mailOnAnswer, bool mailOnComment, long userId);
    }
}